install: make-install-dirs
	install -m 755 usr/bin/gromlist /usr/bin/
	install -m 755 usr/lib/gromlist/gromlist.py /usr/lib/gromlist
	install -m 644 usr/share/applications/Gromlist.desktop /usr/share/applications/
	install -m 644 usr/share/locale/da/LC_MESSAGES/gromlist.mo /usr/share/locale/da/LC_MESSAGES/
	install -m 644 usr/share/locale/es/LC_MESSAGES/gromlist.mo /usr/share/locale/es/LC_MESSAGES/
	install -m 644 usr/share/locale/fr/LC_MESSAGES/gromlist.mo /usr/share/locale/fr/LC_MESSAGES/
	install -m 644 usr/share/pixmaps/gromlist.svg /usr/share/pixmaps/
	install -m 644 usr/share/gromlist/images/*.png /usr/share/gromlist/images/
	install -m 644 usr/share/gromlist/images/flags/*.png /usr/share/gromlist/images/flags

make-install-dirs:
	mkdir -p /usr/bin
	mkdir -p /usr/lib/gromlist
	mkdir -p /usr/share/applications
	mkdir -p /usr/share/locale/da/LC_MESSAGES/
	mkdir -p /usr/share/locale/es/LC_MESSAGES/
	mkdir -p /usr/share/locale/fr/LC_MESSAGES/
	mkdir -p /usr/share/gromlist/images/flags
	mkdir -p /usr/share/pixmaps

uninstall:
	rm /usr/bin/gromlist
	rm -rf /usr/lib/gromlist
	rm /usr/share/applications/Gromlist.desktop
	rm /usr/share/locale/da/LC_MESSAGES/gromlist.mo
	rm /usr/share/locale/es/LC_MESSAGES/gromlist.mo
	rm /usr/share/locale/fr/LC_MESSAGES/gromlist.mo
	rm /usr/share/pixmaps/gromlist.svg
	rm -rf /usr/share/gromlist/

deb:
	mkdir package
	cp -r usr package
	cp -r DEBIAN package
	dpkg-deb --build package gromlist-0.3.2.deb
	rm -rf package

tgz:
	mkdir gromlist-0.3.2
	cp -r usr gromlist-0.3.2
	cp Makefile gromlist-0.3.2
	cp CHANGELOG gromlist-0.3.2
	cp COPYING gromlist-0.3.2
	tar -cvzf gromlist-0.3.2.tar.gz gromlist-0.3.2/
	rm -rf gromlist-0.3.2

clean:
	find . -type f -iregex '.*~$$'  -print | xargs rm -rf
	find . -type f -iregex '.*\.pyc$$'  -print | xargs rm -rf
	find . -type f -iregex '.*\.bak$$'  -print | xargs rm -rf
